home *** CD-ROM | disk | FTP | other *** search
- property peecStartChan, peecEndChan, SolveH, SolveV, TimeBarChan, TimeBarStartH, TimeCountN, TimeOutNum, TolerNum, SndCstStartNum
-
- on birth me
- global UEasy
- if voidp(UEasy) then
- set TolerNum to 5
- else
- set TolerNum to 9 - UEasy
- end if
- set TimeCountN to 0
- set TimeOutNum to 112
- set TimeBarChan to 41
- set TimeBarStartH to 256
- set peecStartChan to 5
- set peecEndChan to 36
- set SolveH to 256
- set SolveV to 144
- set SndCstStartNum to the number of cast "NotIn.snd"
- go("puzzle1")
- updateStage()
- repeat with x = peecStartChan to peecEndChan
- puppetSprite(x, 1)
- end repeat
- puppetSprite(TimeBarChan, 1)
- return me
- end
-
- on MasterTimer me
- set TimeCountN to TimeCountN + 2
- set the locH of sprite TimeBarChan to TimeBarStartH - (TimeCountN * 4)
- if TimeCountN > (TimeOutNum - 1) then
- cleanup(me)
- go("TimesUp")
- else
- if TimeCountN > (TimeOutNum - (TimeOutNum / 2)) then
- go("Puzzle2")
- else
- go(marker(0) + 1)
- exit
- end if
- end if
- end
-
- on cleanup me
- puppetSprite(TimeBarChan, 0)
- repeat with x = peecStartChan to peecEndChan
- puppetSprite(x, 0)
- end repeat
- puppetSound(3, 0)
- end
-
- on ExitPuzzle me
- cleanup(me)
- go("1")
- end
-
- on PuzzlePeecDrag me, spritnum
- end
-
- on PuzzlePeecDrop me, spritnum
- set h to the locH of sprite spritnum
- set v to the locV of sprite spritnum
- if (h < (SolveH + TolerNum)) and (h > (SolveH - TolerNum)) then
- if (v < (SolveV + TolerNum)) and (v > (SolveV - TolerNum)) then
- set the locH of sprite spritnum to SolveH
- set the locV of sprite spritnum to SolveV
- puppetSound(3, SndCstStartNum + random(6))
- end if
- else
- puppetSound(3, SndCstStartNum)
- exit
- end if
- checkAllPieces()
- end
-
- on checkAllPieces me
- repeat with x = peecStartChan to peecEndChan
- set h to the locH of sprite x
- set v to the locV of sprite x
- if (h = SolveH) and (v = SolveV) then
- nothing()
- next repeat
- end if
- exit
- end repeat
- cleanup(me)
- go("PuzzleSolved")
- end
-